﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="UploadPhoto.aspx.vb" Inherits="UploadPhoto" MasterPageFile="~/MainLayout.master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <h1>Upload Photo</h1>
    <hr />

    <div runat="server" id="divError" class="msg-box-error" visible="false" enableviewstate="false">

        <span class="title">Error</span><br />
        <asp:Label ID="lblMsgError" runat="server" Text="" />
    </div>
    <div runat="server" id="divSuccessful" class="msg-box-success" visible="false" enableviewstate="false">

        <span class="title">Successful</span><br />
        <asp:Label ID="lblMsgSuccessful" runat="server" Text="Success" />

    </div>
    <p><%--Description of the page--%></p>
    <asp:Label ID="lblPropertyID" runat="server" Visible="false" />
    <asp:Label ID="lblPhotoCount" runat="server" Visible="false" />
    <asp:Label ID="lblhidListType" runat="server" Visible="false" />

    <div class="General-info-Container">

        <table width="100%">
            <tr>
                <td class="General-info-title" style="width: 150px;">
                    <h3>Photo</h3>
                </td>
                <td>
                    <div class="General-info-title-line"></div>
                </td>

            </tr>
        </table>

        <div style="background-image: url(images/style01/AddPhoto-top.png); background-repeat: repeat-x; background-position: top; background-color: #f5f5f5; padding-top: 7px;">
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td valign="top" style="background-image: url(images/style01/AddPhoto-divider.png); background-repeat: repeat-y; background-position: right;">
                        <table cellpadding="0" cellspacing="0" style="">
                            <tr>
                                <td colspan="2" align="right"></td>
                            </tr>
                            <asp:Repeater ID="repPhoto" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:FileUpload ID="filRepPhoto" runat="server" /></td>
                                        <td align="center"></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <tr>
                                <td align="right" colspan="2"></td>
                            </tr>
                        </table>


                    </td>
                    <td>

                        <asp:DataList ID="dlUploadedPhoto" runat="server" RepeatColumns="1" RepeatDirection="Horizontal" RepeatLayout="Table" CellPadding="5" CellSpacing="5">
                            <ItemTemplate>
                                <table cellpadding="5" cellspacing="5" width="100%">
                                    <tr style="background-image: url(images/style01/AddPhoto-horizon-divider.png); background-repeat: repeat-x; background-position: bottom;">
                                        <td valign="top">Description : 
                                            <asp:TextBox ID="txtDLPictureDesc" runat="server" Width="200px" MaxLength="250" Height="100px" Text='<%#Container.DataItem("PictureDesc").ToString%>' />
                                         <div align="center">
                                                <asp:ImageButton ID="imgRepDel" runat="server" AlternateText="Delete" CommandArgument='<%#Container.DataItem("PictureId").ToString%>' CommandName="DeletePicture" ImageUrl="~/images/style01/DeleteButton.png" />
                                                <cc1:ConfirmButtonExtender ID="cbeDelete" runat="server" TargetControlID="imgRepDel" ConfirmText="Are you sure you want to delete this photo?" />
                                            </div>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblPicture" runat="server" Visible="false" Text='<%#Container.DataItem("Picture").ToString%>' />
                                            <a rel="photo" href="<%#Container.DataItem("pictureURL").ToString%>" title="<%#Container.DataItem("PictureDesc").ToString%>">
                                                <img src="<%#Container.DataItem("pictureURL").ToString%>" width="150px" height="100px" border="1" alt="<%#Container.DataItem("PictureDesc").ToString%>" style="border-color: Gray;" /><br />
                                            </a>
                                           
                                            <center>
                                                <%--     Main : <asp:CheckBox ID="rbtRepPhoto" name="Photo" runat="server" Checked='<%# Convert.ToBoolean(Container.DataItem("isThumbnail")) %>' /><cc1:MutuallyExclusiveCheckBoxExtender ID="mecPhoto" runat="server" TargetControlID="rbtRepPhoto" Key="Thumnnail" />--%>


                                                <asp:RadioButtonList ID="rblSelectedPicture" runat="server" SelectedValue='<%# Container.DataItem("isThumbnail") %>' AutoPostBack="true" OnSelectedIndexChanged="rblSelectedPicture_SelectedIndexChanged">
                                                    <asp:ListItem Text="Main" Value="1" />
                                                    <asp:ListItem Text="Secondary" Value="0" />
                                                    <asp:ListItem Text="Others" Value="2" />
                                                </asp:RadioButtonList>
                                            </center>
                                            <div style="clear: both; display: none;">
                                                <div style="background-color: white; height: 1px;"></div>
                                                <div style="background-color: Gray; height: 1px;"></div>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:DataList>


                    </td>
                </tr>
                <tr>

                    <td align="right" style="border-top: 1px solid #c2c2c2; height: 35px;">
                        <asp:Button ID="btnAddMore" Text="Add More Upload" runat="server" CssClass="search-btn" Width="120px" />&nbsp;
                                    <asp:Button ID="btnUpload" Text="Upload" runat="server" CssClass="search-btn" Width="80px" />
                    </td>
                    <td align="right" style="border-top: 1px solid #c2c2c2; height: 35px;">
                        <asp:Button ID="btnSaveDescription" Text="Update Description" runat="server" CssClass="search-btn" Width="120px" />&nbsp;
                                    <asp:Button ID="btnDone" Text="Done" runat="server" CssClass="search-btn" Width="80px" />
                    </td>
                </tr>
            </table>

        </div>


    </div>






</asp:Content>


